<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<c:if test="${!empty subscribes}">
	<h1>Subscribes</h1>
	<form method="post" action="subscribes/search">
		<input type="text" class="input-medium"
			value="<c:if test="${not empty user}"></c:if>" name="user"
			placeholder='search' />
		<input type="submit" class="btn btn-primary" value="Search" />
	</form>

	<table class="table table-hover">
		<tr>
			<th>User</th>
			<th>Name service</th>
			<th>Description service</th>
			<th>Action</th>
		</tr>
		<c:forEach items="${subscribes}" var="subscribe">
			<tr>
				<td>${subscribe.user.firstname}${subscribe.user.lastname}</td>
				<td>${subscribe.service.nameService}</td>
				<td>${subscribe.service.description}</td>
				<td><a class="btn btn-danger"
					href='<c:url value="/subscribes/delete/${subscribe.id}"></c:url>'>
						Delete</a></td>

			</tr>
		</c:forEach>
	</table>
</c:if>
<br />

